package com.qo.qsdk.notify;

import android.util.Log;

import com.appsflyer.AppsFlyerLib;
import com.appsflyer.internal.bb;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import com.qo.qsdk.QSDK;

public class QFirebaseMessagingService extends FirebaseMessagingService {

    private static final String TAG = QFirebaseMessagingService.class.getSimpleName();

    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {
//        super.onMessageReceived(remoteMessage);
        try {
            Log.e(TAG, "onMessageReceived: " + remoteMessage.toString() + "来自：" + remoteMessage.getFrom() + "消息的id:" + remoteMessage.getMessageId() +
                    "消息的发送时间：" + remoteMessage.getSentTime() + "消息的内容：" + remoteMessage.getData() + "消息发送给：" + remoteMessage.getTo() + "消息的通知" +
                    remoteMessage.getNotification());
        }catch (Exception e){

        }
        if(remoteMessage.getData().containsKey("af-uinstall-tracking")){
            return;
        } else {
            // handleNotification(remoteMessage);
        }


    }

    @Override
    public void onDeletedMessages() {
        super.onDeletedMessages();
        Log.e(TAG, "你删除了消息哦");
    }

    @Override
    public void onNewToken(String s) {
        super.onNewToken(s);
        AppsFlyerLib.getInstance().updateServerUninstallToken(getApplicationContext(), s);
    }
}
